<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <canvas id="myCanvas" width="500" height="500"></canvas>
</body>
<script>

    var c = document.getElementById("myCanvas");
    var cxt = c.getContext("2d");
    cxt.fillStyle = "#FF0000";
    cxt.fillRect(0, 0, 500, 500);

    cxt.moveTo(10, 490);
    cxt.lineTo(80, 350);
    cxt.lineTo(140, 400);
    cxt.lineTo(200, 220);
    cxt.stroke();

</script>

</html>